package algutil.msg;

public class Message {

	public static int MESSAGE_INFO = 0;

	public static int MESSAGE_ERREUR = 1;

	private String description;

	private int type;

	public Message(String msg, int typeMsg) {

		description = msg;
		type = typeMsg;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String toString() {

		String msg = "";
		if (type == MESSAGE_ERREUR) {
			msg = "ERREUR : " + description;
		} else {
			msg = "INFO : " + description;
		}
		return msg;
	}
}
